using System.Net.Mail;
using SpiderMaster.AspNet.TradingSystem.BusinessLogicLayer;

namespace SpiderMaster.AspNet.TradingSystem
{
    public partial class EmailManagerOld
    {
        public partial class Helper
        {
            public partial class Send
            {
                /// <summary> <see cref="Send"/>'s a Welcome EMail.
                /// </summary>
                /// <param name="UserName">Name of the user.</param>
                /// <param name="FirstName">The first name.</param>
                /// <param name="Password">The password.</param>
                /// <param name="ToMemberId">To member id.</param>
                /// <param name="ToEmailAddress">To email address.</param>
                /// <param name="RequireActivation">if set to <c>true</c> [require activation].</param>
                /// <returns></returns>
                public static bool WelcomeEmail(string UserName, string FirstName, string Password, int ToMemberId, string ToEmailAddress, bool RequireActivation)
                {
                    using (MailMessage EmailMessage = new MailMessage(SiteSettings.Current.MailSenderAddressFormatted, ToEmailAddress))
                    {
                        EmailMessage.IsBodyHtml = true;
                        Reader.LoadRegistraion(EmailMessage, UserName, FirstName, Password, ToEmailAddress, RequireActivation);
                        return EmailManager.SendCompletedEmail(ToMemberId, EmailMessage);
                    }
                }
            }
        }
    }
}